# Contributor: Milan P. Stanić <mps@arvanta.net>
# Maintainer: Milan P. Stanić <mps@arvanta.net>
pkgname=simavr
pkgver=1.6
pkgrel=0
pkgdesc="lean, mean Atmel AVR simulator "
url="https://github.com/buserror/simavr"
arch="all"
license="GPL-3.0-or-later"
options="!check" # tests fails
makedepends="avr-libc freeglut-dev elfutils-dev bash"
subpackages="$pkgname-dev"
source="$pkgname-$pkgver.tar.gz::https://github.com/buserror/simavr/archive/v$pkgver.tar.gz"

build() {
	export CFLAGS="$CFLAGS -fPIC -O2 -std=gnu99 -Wno-error=stringop-truncation"
	make RELEASE=1 SIMAVR_VERSION=$pkgver build-simavr
	make RELEASE=1 SIMAVR_VERSION=$pkgver -C examples/parts
}

check() {
	make RELEASE=1 -C tests
}

package() {
	make RELEASE=1 SIMAVR_VERSION=$pkgver DESTDIR="$pkgdir/usr" install
}

sha512sums="19f8ec8e8d1bc4173f3eb9ae6447a181452ab5a7bfbf4c7e419bec14014a85256cf58db4635a698a3d56531d8bc735de3bd8b636b7c7665f848956ff181bdc4d  simavr-1.6.tar.gz"
